package com.jsp.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import com.jsp.bean.AdminBean;
import com.jsp.util.DBUtil;

public class AdminDao {

	public  AdminBean adminlogin(AdminBean admin) throws SQLException{
		Connection con=DBUtil.getConnection();
		PreparedStatement pstmt=con.prepareStatement("select adminName,adminPassword from administratorinformation where adminName=? and adminPassword=?");
		pstmt.setString(1, admin.getAdminName());
		pstmt.setString(2, admin.getAdminPassword());
		ResultSet rs=pstmt.executeQuery();
		AdminBean newAdmin=null;
		if(rs.next()){
			newAdmin=new AdminBean();
			newAdmin.setAdminName("adminName");
			newAdmin.setAdminPassword("adminPassword");
			System.out.println(newAdmin.getAdminName());
			System.out.println(newAdmin.getAdminPassword());
			 
		}
		DBUtil.closeConn(rs, pstmt, con);
		
		
		
		
		
		return newAdmin;
		
		
	}
}
